/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "regioni")
@NamedQueries({
    @NamedQuery(name = "Regioni.findAll", query = "SELECT r FROM Regioni r"),
    @NamedQuery(name = "Regioni.findById", query = "SELECT r FROM Regioni r WHERE r.id = :id")})
public class Regioni implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Lob
    @Column(name = "regione")
    private String regione;

    public Regioni() {
    }

    public Regioni(Integer id) {
        this.id = id;
    }

    public Regioni(Integer id, String regione) {
        this.id = id;
        this.regione = regione;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRegione() {
        return regione;
    }

    public void setRegione(String regione) {
        this.regione = regione;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Regioni)) {
            return false;
        }
        Regioni other = (Regioni) object;
        return (this.id != null || other.id == null) && (this.id == null || this.id.equals(other.id));
    }

    @Override
    public String toString() {
        return "jpa.Regioni[id=" + id + "]";
    }

}
